package com.ddzh.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import org.apache.ibatis.type.JdbcType;

import java.io.Serializable;
import java.util.Objects;

@Data
@TableName("item_group_t")
public class CheckGroup implements Serializable {
    @TableId(value = "id" ,type = IdType.AUTO)
    private Long id;
    private String code;
    private String name;
    @TableField("helpcode")
    private String helpCode;
    private char sex;
    private String remark;
    private String attention;
    private int is_delete;

    @Override //重写注解不能缺少，重写equals时一定要重写hashCode方法
    public boolean equals(Object o) {//参数Object类型不能替换为其他类型
        if (this == o) return true;//用 == 判断参数是否是当前对象的引用（比较的是地址）
        if (!(o instanceof CheckGroup)) return false; //参数是否为正确的类型
        CheckGroup that = (CheckGroup) o;
        return getSex() == that.getSex() &&//对于类中关键属性，检查参数传入对象的属性是否与之相匹配
                getIs_delete() == that.getIs_delete() &&
                getId().equals(that.getId()) &&
                getCode().equals(that.getCode()) &&
                getName().equals(that.getName()) &&
                getHelpCode().equals(that.getHelpCode()) &&
                getRemark().equals(that.getRemark()) &&
                getAttention().equals(that.getAttention());
    }

    @Override
    public int hashCode() {//根据内容获取对象的hash值
        return Objects.hash(getId(), getCode(), getName(), getHelpCode(), getSex(), getRemark(), getAttention(), getIs_delete());
    }
}
